<?php


namespace Tbf\Bundle\YntAuthBundle\Denglu;


use Tbf\Bundle\YntAuthBundle\Service\MediaManager;

class DengluMediaIdMap {
    /**
     * @var array map[media_id]name_en
     */
    protected $media_id_name_en_map;
    /** @var  MediaManager */
    protected $media_manager;
    function __construct($media_id_name_en_map,MediaManager $media_manager){
        $this->media_id_name_en_map;
        $this->media_manager = $media_manager;
    }
    function getById($media_id){
        if (empty($this->media_id_name_en_map[$media_id])){
            return null;
        }
        $name_en = $this->media_id_name_en_map[$media_id];
        return $this->media_manager->getMediaByMediaNameEn($name_en);
    }
}